//
//  HMThiredCell.m
//  学习的时长
//
//  Created by 李贺 on 2017/1/8.
//  Copyright © 2017年 李贺. All rights reserved.
//

#import "HMThiredCell.h"
#import <Masonry.h>

@implementation HMThiredCell

// 重写父类的初始化方法,在此方法中添加cell中的子控件
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 添加子控件
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    UIImageView *titleImage = [[UIImageView alloc] init];
    [self.contentView addSubview:titleImage];
    titleImage.image = [UIImage imageNamed:@"search_result_book_16x16_"];
    
    [titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(16);
        make.top.equalTo(self.contentView.mas_top).offset(16);
    }];
    
    UILabel *titleLable = [UILabel hm_labelWithText:@"学习记录" fontSize:k_FONT_BIG color:[UIColor blackColor]];
    [self.contentView addSubview:titleLable];
    
    [titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(titleImage);
        make.left.equalTo(titleImage.mas_right).offset(8);
    }];
    
    UILabel *detailLable = [UILabel hm_labelWithText:@"提示:主人,这里为您提供了近期的阅读记录,点击查看哦!" fontSize:k_FONT_NORMAL color:[UIColor darkGrayColor]];
    
    [self.contentView addSubview:detailLable];
    
    [detailLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLable.mas_bottom).offset(16);
        make.left.equalTo(titleLable);
        make.right.equalTo(self.contentView).offset(-8);
    }];
    
    detailLable.numberOfLines = 0;

}


@end
